package com.wushijia.highconcurrency.forkjoin;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;

public class Demo1 {

  private static DecimalFormat df = new DecimalFormat("0");
  private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  private static DecimalFormat nf = new DecimalFormat("0.00");

  private String name;

  public Demo1(String name){
    this.name = name;
  }

  public Demo1(){}

  public static void main(String[] args) {
    Demo1 demo1 = new Demo1();
    System.out.println(Arrays.toString("sedwr".toCharArray()));
    System.out.println(new BigDecimal("0.00").equals(BigDecimal.ZERO));
    List<String> stringList = new ArrayList<>();
    stringList.add("d");
    stringList.add("e");
    stringList.add("f");
    System.out.println(String.join("-", "a", "b", "c"));
    System.out.println(String.join("-", stringList));
    System.out.println(Arrays.toString(stringList.toArray(new String[stringList.size()])));
    System.out.println(-2>>>1);//10000010
    System.out.println(Integer.toBinaryString(-2));
    System.out.println(Integer.toBinaryString(-2>>>3));
    int[] nums = new int[]{1, 2, 3, 4};
    System.out.println(Arrays.toString(nums));

    LocalDateTime localDateTime = LocalDateTime.now();
    LocalDate localDate = localDateTime.toLocalDate().plus(1, ChronoUnit.DAYS);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    LinkedHashMap<String, Object> dataMap = new LinkedHashMap<String, Object>();
    String string = "r234,324,";
    System.out.println(string.split(",").length);
    try {
      System.out.println(sdf.parse(localDate.toString()));
    } catch (ParseException e) {
      e.printStackTrace();
    }
  }
}
